package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface OrderDetailMapper {

    void insertBatch(List<OrderDetail> detailList);


    OrderDetail  getOrderDetail(OrderDetail orderDetail);

    void update(OrderDetail detail);

    void insert(OrderDetail orderDetail);

    @Select("select * from order_detail where order_id = #{id}")
    List<OrderDetail> getOrderId(Long id);

    @Delete("delete from order_detail where order_id = #{orderId}")
    void deleteByOrderId(long orderId);
}
